USE [AdventureWorksLT]
GO

/****** Object:  StoredProcedure [dbo].[UPDATE_ADDRESS]    Script Date: 04/29/2012 23:46:41 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[UPDATE_ADDRESS]') AND type in (N'P', N'PC'))
DROP PROCEDURE [dbo].[UPDATE_ADDRESS]
GO

USE [AdventureWorksLT]
GO

/****** Object:  StoredProcedure [dbo].[UPDATE_ADDRESS]    Script Date: 04/29/2012 23:46:41 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO


-- =============================================
-- Author:		<River Li>
-- Create date: <2012-04-29>
-- Description:	<INSERT a record>
-- =============================================
CREATE PROCEDURE [dbo].[UPDATE_ADDRESS] 
   @AddressID int
   ,@AddressLine1 nvarchar(60)
   ,@AddressLine2 nvarchar(60)
   ,@City nvarchar(30)
   ,@StateProvince Name
   ,@CountryRegion Name
   ,@PostalCode nvarchar(15)
   ,@rowguid uniqueidentifier
   ,@ModifiedDate datetime
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

    -- Insert statements for procedure here
	UPDATE [AdventureWorksLT].[SalesLT].[Address]
	SET
			   [AddressLine1] = @AddressLine1
			   ,[AddressLine2] = @AddressLine2
			   ,[City] = @City
			   ,[StateProvince] = @StateProvince
			   ,[CountryRegion] = @CountryRegion
			   ,[PostalCode] = @PostalCode
			   ,[rowguid] = @rowguid
			   ,[ModifiedDate] = @ModifiedDate
	WHERE
		[AddressID] = @AddressID

END


GO

